package view;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import java.awt.Color;
import java.awt.Component;

import javax.swing.Box;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import javax.swing.UIManager;

import java.awt.Font;
import java.awt.event.ActionListener;
import java.awt.event.ItemListener;

import javax.swing.JButton;
/**
 * this class for frame of GetCustomerList
 * @author liran
 *
 */
public class GetCustomerListGui extends AbstractGUI {

	private JPanel contentPane;
/**
 * list campain 
 */
	private JComboBox CampaincomboBox = null;
	/**
	 * list of customer 
	 */
	private JComboBox CustomercomboBox = null;
	/**
	 * next botton 
	 */
	private JButton btnNext = null;
	/**
	 * back botton
	 */
	private JButton btnBack = null;
	/**
	 * log out botton
	 */
	private JButton btnLogOut = null;
	/**
	 * Launch the application.
	 */


	/**
	 * Create the frame.
	 */
	public GetCustomerListGui() {
		//setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(500, 200, 450, 300);
		getContentPane().setForeground(new Color(255, 240, 245));
		getContentPane().setBackground(new Color(106, 90, 205));
	//	getContentPane().setBorder(new EmptyBorder(5, 5, 5, 5));
	//	setContentPane(contentPane);
		getContentPane().setLayout(null);
		
		CampaincomboBox = new JComboBox();
		CampaincomboBox.setBounds(209, 73, 150, 26);
		getContentPane().add(CampaincomboBox);
		
		JLabel lblChooseACampin = new JLabel("Choose a campain");
		lblChooseACampin.setForeground(new Color(250, 250, 210));
		lblChooseACampin.setFont(new Font("Monospaced", Font.PLAIN, 16));
		lblChooseACampin.setHorizontalAlignment(SwingConstants.CENTER);
		lblChooseACampin.setBounds(10, 71, 170, 26);
		getContentPane().add(lblChooseACampin);
		
		JLabel lblChooseACustomer = new JLabel("Choose a customer");
		lblChooseACustomer.setHorizontalAlignment(SwingConstants.CENTER);
		lblChooseACustomer.setForeground(new Color(250, 250, 210));
		lblChooseACustomer.setFont(new Font("Monospaced", Font.PLAIN, 16));
		lblChooseACustomer.setBounds(10, 119, 170, 26);
		getContentPane().add(lblChooseACustomer);
		
		CustomercomboBox = new JComboBox();
		CustomercomboBox.setBounds(209, 119, 150, 25);
		CustomercomboBox.setEnabled(false);
		getContentPane().add(CustomercomboBox);
		
		btnNext = new JButton("Next");
		btnNext.setBounds(244, 208, 89, 23);
		getContentPane().add(btnNext);
		
		btnBack = new JButton("Back");
		btnBack.setBounds(36, 208, 89, 23);
		getContentPane().add(btnBack);
		
		btnLogOut = new JButton("Log out");
		btnLogOut.setBounds(345, 0, 89, 23);
		getContentPane().add(btnLogOut);
		
		JLabel lblC = new JLabel("CAMPAINS");
		lblC.setHorizontalAlignment(SwingConstants.CENTER);
		lblC.setLabelFor(this);
		lblC.setFont(new Font("Traditional Arabic", Font.ITALIC, 17));
		lblC.setBounds(63, 25, 242, 37);
		getContentPane().add(lblC);
		setVisible(true);
	}
	
	
	
	/**
	 * add Action for next button
	 * @param acListener
	 */
	public void addbtnNextAL(ActionListener acListener)
	{
		btnNext.addActionListener(acListener);
	}
	/**
	 * add Action for log out button
	 * @param acListener
	 */
	public void addbtnlogoutAL(ActionListener acListener)
	{
		btnLogOut.addActionListener(acListener);
	}
	/**
	 * add Action for back button
	 * @param acListener
	 */
	public void addbtnBackAL(ActionListener acListener)
	{
		btnBack.addActionListener(acListener);
	}
	/**
	 * add action to combo box
	 * @param I
	 */
	public void addCustomerComboAC(ItemListener I) {
		CustomercomboBox.addItemListener(I);
	}
	/**
	 *  add action to combo box
	 * @param I
	 */
	public void addComboCampAc(ItemListener I)
	{
		CampaincomboBox.addItemListener(I);
	}
	/**
	 *  add item to combo box
	 * @param s
	 */
	public void setItemCampComboBOx(String s){
		CampaincomboBox.addItem(s);
	}
	/**
	 * get the choose item
	 * @return choose item
	 */
	public String getSeclectItemS()
	{
		return (String) CampaincomboBox.getSelectedItem();
	}
	/**
	 * get the choose item
	 * @return choose item
	 */
	public String getSeclectCustomerItemS()
	{
		return (String) CustomercomboBox.getSelectedItem();
	}
	/**
	 * get the combo box object
	 * @return CustomercomboBox
	 */
	public JComboBox getCustomercomboBox()
	{
		return CustomercomboBox;
	}
	/**
	 * add item for combo box
	 * @param item 
	 */
	public void setItemCustComboBOx(String s){
		CustomercomboBox.addItem(s);
	}

}
















